[staticanalysis]: Fix in_status_line
authorColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 21:35:03 +0000 (17:35 -0400)
committerColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 22:08:49 +0000 (18:08 -0400)
We need to end the status line *after* we've done a pull, as ostree
admin upgrade does.  Also add the correct in_status_line assignment.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

src/ostree/ot-admin-builtin-switch.c

index 44861e52dd68bcc27ee22aa35c19e5a306ad8322..a6a18626cfb7e237001f376e154abf55d7e6f75d 100644 (file)
@@ -126,15 +126,10 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeSysroot *sysroot, GCancell
   if (console)
     {
       gs_console_begin_status_line (console, "", NULL, NULL);
+      in_status_line = TRUE;
       progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
     }
 
-  if (in_status_line)
-    {
-      gs_console_end_status_line (console, NULL, NULL);
-      in_status_line = FALSE;
-    }
-
   /* Always allow older...there's not going to be a chronological
    * relationship necessarily.
    */
@@ -144,6 +139,12 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeSysroot *sysroot, GCancell
                                      cancellable, error))
     goto out;
 
+  if (in_status_line)
+    {
+      gs_console_end_status_line (console, NULL, NULL);
+      in_status_line = FALSE;
+    }
+
   if (!ostree_sysroot_upgrader_deploy (upgrader, cancellable, error))
     goto out;